package com.yantu.controller.student;

import com.yantu.bean.MessageUser;
import com.yantu.mapper.MessageUserMapper;
import com.yantu.util.Result;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@ApiModel("消息标记已读接口信息")
public class StudentMessageReadController {
    @Autowired
    MessageUserMapper messageUserMapper;

    @PutMapping("/messageRead/{id}")
    @ApiOperation("当前用户信息")
    public Result userCurrent(@PathVariable("id") Integer id) {


        MessageUser messageUser = messageUserMapper.selectById(id);
        messageUser.setReaded(1);
        messageUserMapper.updateById(messageUser);
        return Result.succ(200,"成功",null);
    }
}
